/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.pretorius.question3.lspViolation.model;

import java.math.BigDecimal;

/**
 *
 * @author griddy
 */
public class TandemBike extends Bicycle{
    
    public TandemBike()
    {
        super();
    }
    
     public TandemBike(BigDecimal frameWeight)
    {
        super(frameWeight);
    }
    
    /*Violates LSP - Object nolonger substitutable with super Object*/
    public BigDecimal calculateKeneticEnergy(BigDecimal meterPerSecond,BigDecimal riderWieght , BigDecimal secondRiderWieght )
    {
        BigDecimal weight = super.getFrameWeight().add(riderWieght ).add(secondRiderWieght);
        //E=m.(v*v)
        return BigDecimal.valueOf(weight.doubleValue() * Math.pow(meterPerSecond.doubleValue(), 2));
    }
    
}
